<?php
class Front_NewsController extends FrontController implements IController{
	/**
	 * News_Model
	 * @var Front_News_Model
	 */
	protected $_model;
	public function detailsAction(){
		$id = $this->getContext()->request('newsid',0);
		$details = $this->_model->getForViewDetails($id);
		if(isset($details) && isset($details[News::NAME]))
			$this->view()->setViewTitle($details[News::NAME] .' - ' . $details[News::CATNAME]);
		$this->view()->newsDetails = $details; 
		if(isset($details)){
			if($details['catid'] == "3"){
				$this->view()->setView("feature");
				$this->view()->relatedCats = $this->_model->getRelateCatByIdOrdinal($this->getContext(), $id);
			}else{
				$this->view()->relatedHots = $this->_model->getRelateTopNews($this->getContext(), $id);
				$this->view()->relatedCats = $this->_model->getRelateCatById($this->getContext(), $id);
			}
		}
	}
	/* public function catAction(){
		$id = $this->getContext()->request('catid',0);
		$list = $this->_model->getAllForCatView($this->getContext(), $id);
		$title = "";
		if(count($list)>0){
			$item = $list[0];
			$title = $item[News::CATNAME];
		}else{
			$title = $this->_model->getProductCatName($id); 
		}
		$this->view()->setViewTitle($title);
		$this->view()->title = $title;
		$this->view()->list = $list; 
	} */
}